﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class BrightnessEffectData : EffectOneSourceData
    {
        #region 属性
        private Vector2 _blackPoint = new Vector2(0, 0);
        private Vector2 _whitePoint = new Vector2(1, 1);

        public Vector2 BlackPoint { get => _blackPoint; set { _blackPoint = value; OnPropertyChanged(); SetIsChanges(); } }
        public Vector2 WhitePoint { get => _whitePoint; set { _whitePoint = value; OnPropertyChanged(); SetIsChanges(); } }

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
            {
                return null;
            }

            var effect = new BrightnessEffect()
            {
                BlackPoint = BlackPoint,
                WhitePoint = WhitePoint,
                Source = source,

            };

            return effect;
        }
    }
}
